package edu.grupo4.applaboratorio;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.AdapterView.OnItemClickListener;

public class ItemLaboratorio_Activity extends Activity {
	private String[] laboratorios = { "ORION", "PROFESORES", "CENTAURO", "PHOENIX", "ANDROMEDA"};
	private ListView lvlaboratorios;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.itemlaboratorio_xml);

		lvlaboratorios =(ListView)findViewById(R.id.listViewItemLaboratorio);     
        ArrayAdapter <String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_list_item_1, laboratorios);
        lvlaboratorios.setAdapter(adapter);
        
        lvlaboratorios.setOnItemClickListener(new OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View v, int posicion, long id) {
            	lanzarMaqDisponible(v);
            }
        }); 
	
}
	public void lanzarMaqDisponible(View view) {
        Intent i = new Intent(this, MaqDisponible_Activity.class );
        startActivity(i);
  }  public void lanzarInicio(View view) {
      Intent i = new Intent(this, MainActivity.class );
      startActivity(i);
}
	  
	    
}
